<style scoped>
  .expand-row {
    margin-bottom: 16px;
  }

  .lyx-table-btn {
    margin-right: 5px;
    margin-bottom: 2px;
  }

  .title-size {
    font-weight: bold;
    font-size: 1rem;
  }
</style>
<template>
  <div>
    <Form label-position="right" :label-width="100" style="position: relative;" :model="formDate">
      <Row class="mb20">
        <Col span="13" class="ivu-form-item-label title-size">申请家庭信息</Col>
      </Row>
    <!--  <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">档案编号：</Col>
        <Col span="9" offset="1" class="ivu-form-item-content">
          <Input v-model="formDate.name"></Input>
        </Col>
      </Row>-->
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">申请人姓名：</Col>
        <Col span="9" offset="1" class="ivu-form-item-content">
          <Input v-model="formDate.applyPerson"></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">申请人身份证号：</Col>
        <Col span="9" offset="1" class="ivu-form-item-content">
          <Input v-model="formDate.applyIdCard"></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="16" class="ivu-form-item-label" style="font-weight: 500" v-if="this.ruleData.status===1">此家庭为享受保障家庭,提交后将上报街道进行处理。</Col>
        <Col span="16" class="ivu-form-item-label" style="font-weight: 500" v-if="this.ruleData.status===0">{{this.ruleData.text}}</Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">终止原因说明：</Col>
        <Col span="9" offset="1" class="ivu-form-item-content">
          <Input v-model="formDate.overReasonMemo" type="textarea" :rows="4" placeholder=""/>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">终止类型：</Col>
        <Col span="9" offset="1" class="ivu-form-item-content">
          <Radio v-model="zhongzhi">保障资格终止</Radio>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">终止发放月份：</Col>
        <Col span="9" offset="1">
          <Select v-model="formDate.stopMonth" style="width:200px">
            <Option v-for="item in monthListaa" :value="item" :key="item">{{ item}}</Option>
          </Select>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label"></Col>
        <Col span="9" offset="1" style="color: red" v-if="this.ruleData.stopMonth!==undefined && this.ruleData.stopMonth!==''">
          *注：所选月份为资金停发月份，系统会在下季度资金发放完所选择终止月份之前的资金后对该家庭进行终止操作；如想立即终止请选择下拉框第一个月份，如果终止月份在下拉框月份之后，请在本季度资金发放完毕后再终止。
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">社区终止操作人：</Col>
        <Col span="9" offset="1">
          <Input v-model="formDate.stopActionPerson"></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">社区负责人：</Col>
        <Col span="9" offset="1">
          <Input v-model="formDate.committeePrincipal"></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" class="ivu-form-item-label">受理时间：</Col>
        <Col span="9" offset="1">
          <DatePicker type="date" v-model="formDate.acceptDate" style="width: 200px"></DatePicker>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="13" class="ivu-form-item-label">
          <Button @click="save()">提交</Button>
        </Col>
      </Row>
    </Form>
  </div>
</template>
<script>
import { date2str } from '@/api/eventlist'
export default {
  name: 'Form3',
  data () {
    return {
      bwk: '0',
      paramsArr: [],
      list: [],
      a: '',
      cityList: [],
      zhongzhi: true
    }
  },
  props: {
    formDate: Object,
    ruleData: Object,
    monthListaa: {
      type: Array,
      default: () => {
        return []
      }
    }

  },
  mounted () {
    // this.rowList()
  },
  watch: {
    // params (ret) {
    //   console.log(ret)
    // }
  },
  methods: {
    save (value) {
      console.log(this.monthList, '月份数据')
      console.log(this.ruleData.stopMonth, 'ruleDate的月份数据')
      console.log(this.ruleData, '规则数据')
      this.formDate.acceptDate = date2str(this.formDate.acceptDate)
      if (!this.formDate.overReasonMemo) {
        this.$Notice.error({ title: '请填写变更原因说明', desc: '' })
        return false
      } else if (!this.formDate.acceptDate) {
        this.$Notice.error({ title: '请选择受理时间', desc: '' })
        return false
      } else if (!this.formDate.committeePrincipal) {
        this.$Notice.error({ title: '请填写社区负责人', desc: '' })
        return false
      } else if (!this.formDate.stopActionPerson) {
        this.$Notice.error({ title: '请填写社区变更操作人', desc: '' })
        return false
      } else {
        console.log(this.formDate)
        // 隐藏对话框
        this.$emit('ee')
      }
    }
  }
}
</script>
